Rules for integrands of the form (((a+b Sec[c+d x]))^n)

1.  ∫(((b Sec[c+d x]))^n)dx

1.  ∫(((b Sec[c+d x]))^n)dx  when  n>1

1:  ∫((Sec[c+d x])^n)dx  when  (n/2)∈(SuperPlus[ℤ])

Derivation: Integration by substitution

Basis: If (n/2)∈ℤ, then  ((Sec[c+d x])^n)==(1/d)(((1+((Tan[c+d x])^2)))^((n/2)-1)) (∂_x)Tan[c+d x]

Rule: If (n/2)∈(SuperPlus[ℤ]), then

∫((Sec[c+d x])^n)dx  ⟶  (1/d)Subst[∫(((1+(x^2)))^((n/2)-1))dx,x,Tan[c+d x]]

Program code:

Int[csc[c_.+d_.*x_]^n_,x_Symbol] :=
  -1/d*Subst[Int[ExpandIntegrand[(1+x^2)^(n/2-1),x],x],x,Cot[c+d*x]] /;
FreeQ[{c,d},x] && IGtQ[n/2,0]

2:  ∫(((b Sec[c+d x]))^n)dx  when  n>1

Reference: CRC 313

Reference: CRC 309

Derivation: Secant recurrence 3a with A->0,B->a,C->d,m->m-1,n->-1

Rule: If  n>1, then

∫(((b Sec[c+d x]))^n)dx  ⟶  ((b Sin[c+d x] (((b Sec[c+d x]))^(n-1)))/(d (n-1)))+(((b^2)(n-2))/(n-1))∫(((b Sec[c+d x]))^(n-2))dx

Program code:

Int[(b_.*csc[c_.+d_.*x_])^n_,x_Symbol] :=
  -b*Cos[c+d*x]*(b*Csc[c+d*x])^(n-1)/(d*(n-1)) + 
  b^2*(n-2)/(n-1)*Int[(b*Csc[c+d*x])^(n-2),x] /;
FreeQ[{b,c,d},x] && GtQ[n,1] && IntegerQ[2*n]

2:  ∫(((b Sec[c+d x]))^n)dx  when  n<-1

Reference: CRC 305

Reference: CRC 299

Derivation: Secant recurrence 1a with A->1,B->0,C->0,n->0

Rule: If  n<-1, then

∫(((b Sec[c+d x]))^n)dx  ⟶  -((Sin[c+d x] (((b Sec[c+d x]))^(n+1)))/(b d n))+(((n+1))/((b^2) n))∫(((b Sec[c+d x]))^(n+2))dx

Program code:

Int[(b_.*csc[c_.+d_.*x_])^n_,x_Symbol] :=
  Cos[c+d*x]*(b*Csc[c+d*x])^(n+1)/(b*d*n) + 
  (n+1)/(b^2*n)*Int[(b*Csc[c+d*x])^(n+2),x] /;
FreeQ[{b,c,d},x] && LtQ[n,-1] && IntegerQ[2*n]

3:  ∫Sec[c+d x]dx

Reference: G&R 2.526.9, CRC 294, A&S 4.3.117

Reference: G&R 2.526.1, CRC 295, A&S 4.3.116

Derivation: Integration by substitution

Basis: Sec[c+d x]==(1/d)Subst[(1/(1-(x^2))),x,Sin[c+d x]](∂_x)Sin[c+d x]

Rule:

∫Sec[c+d x]dx  ⟶  ((ArcTanh[Sin[c+d x]])/d)

Program code:

Int[csc[c_.+d_.*x_],x_Symbol] :=
(* -ArcCoth[Cos[c+d*x]]/d /; *)
  -ArcTanh[Cos[c+d*x]]/d /;
FreeQ[{c,d},x]

x:  ∫(1/(Sec[c+d x]))dx

Note: This rule not necessary since Mathematica automatically simplifies (1/(Sec[z])) to Cos[z].

Rule:

∫(1/(Sec[c+d x]))dx  ⟶  ∫Cos[c+d x]dx  ⟶  ((Sin[c+d x])/d)

Program code:

(* Int[1/csc[c_.+d_.*x_],x_Symbol] :=
  -Cos[c+d*x]/d /;
FreeQ[{c,d},x] *)

4:  ∫(((b Sec[c+d x]))^n)dx  when  (n^2)==(1/4)

Derivation: Piecewise constant extraction

Basis: (∂_x)((((b Sec[c+d x]))^n) (((Cos[c+d x]))^n))==0

Rule: If  (n^2)==(1/4), then

∫(((b Sec[c+d x]))^n)dx  ⟶  (((b Sec[c+d x]))^n) (((Cos[c+d x]))^n) ∫(1/((Cos[c+d x])^n))dx

Program code:

Int[(b_.*csc[c_.+d_.*x_])^n_,x_Symbol] :=
  (b*Csc[c+d*x])^n*Sin[c+d*x]^n*Int[1/Sin[c+d*x]^n,x] /;
FreeQ[{b,c,d},x] && EqQ[n^2,1/4]

5:  ∫(((b Sec[c+d x]))^n)dx  when  n∉ℤ

Derivation: Piecewise constant extraction

Basis: (∂_x)((((b Sec[c+d x]))^n) (((Cos[c+d x]))^n))==0

Note: Decrementing the exponents in the piecewise constant factor results in canceling out the cosine factor introduced when integrating the power of the cosine.

Rule: If  2n∉ℤ, then

∫(((b Sec[c+d x]))^n)dx  ⟶  (((b Sec[c+d x]))^(n-1)) (((((Cos[c+d x])/b)))^(n-1)) ∫(1/(((((Cos[c+d x])/b)))^n))dx

Program code:

Int[(b_.*csc[c_.+d_.*x_])^n_,x_Symbol] :=
  (b*Csc[c+d*x])^(n-1)*((Sin[c+d*x]/b)^(n-1)*Int[1/(Sin[c+d*x]/b)^n,x]) /;
FreeQ[{b,c,d,n},x] && Not[IntegerQ[n]]

2:  ∫(((a+b Sec[c+d x]))^2)dx

Derivation: Algebraic expansion

Basis: (((a+b z))^2)==(a^2)+2 a b z+(b^2) (z^2)

Rule:

∫(((a+b Sec[c+d x]))^2)dx  ⟶  (a^2)x+2a b∫Sec[c+d x]dx+(b^2)∫((Sec[c+d x])^2)dx

Program code:

Int[(a_+b_.*csc[c_.+d_.*x_])^2,x_Symbol] :=
  a^2*x + 2*a*b*Int[Csc[c+d*x],x] + b^2*Int[Csc[c+d*x]^2,x] /;
FreeQ[{a,b,c,d},x]

3.  ∫(((a+b Sec[c+d x]))^n)dx  when  (a^2)-(b^2)==0

1.  ∫(((a+b Sec[c+d x]))^n)dx  when  (a^2)-(b^2)==0 ∧ 2n∈ℤ

1.  ∫(((a+b Sec[c+d x]))^n)dx  when  (a^2)-(b^2)==0 ∧ 2n∈(SuperPlus[ℤ])

1:  ∫(Sqrt[a+b Sec[c+d x]])dx  when  (a^2)-(b^2)==0

Author: Martin Welz on 24 June 2011

Derivation: Integration by substitution

Basis: If  (a^2)-(b^2)==0, then (Sqrt[a+b Sec[c+d x]])==((2b )/d) Subst[(1/(a+(x^2))),x,((b Tan[c+d x])/(Sqrt[a+b Sec[c+d x]]))](∂_x)((b Tan[c+d x])/(Sqrt[a+b Sec[c+d x]]))

Rule: If  (a^2)-(b^2)==0, then

∫(Sqrt[a+b Sec[c+d x]])dx  ⟶  ((2b)/d)Subst[∫(1/(a+(x^2)))dx,x,((b Tan[c+d x])/(Sqrt[a+b Sec[c+d x]]))]

Program code:

Int[Sqrt[a_+b_.*csc[c_.+d_.*x_]],x_Symbol] :=
  -2*b/d*Subst[Int[1/(a+x^2),x],x,b*Cot[c+d*x]/Sqrt[a+b*Csc[c+d*x]]] /;
FreeQ[{a,b,c,d},x] && EqQ[a^2-b^2,0]

2:  ∫(((a+b Sec[c+d x]))^n)dx  when  (a^2)-(b^2)==0 ∧ n>1 ∧ 2n∈ℤ

Derivation: Symmetric secant recurrence 1b with A->a,B->b,m->0,n->n-1

Rule: If  (a^2)-(b^2)==0 ∧ n>1 ∧ 2n∈ℤ, then

∫(((a+b Sec[c+d x]))^n)dx  ⟶  
(((b^2)Tan[c+d x](((a+b Sec[c+d x]))^(n-2)))/(d(n-1)))+(a/(n-1))∫(((a+b Sec[c+d x]))^(n-2)) (a (n-1)+b (3 n-4)Sec[c+d x])dx

Program code:

Int[(a_+b_.*csc[c_.+d_.*x_])^n_,x_Symbol] :=
  -b^2*Cot[c+d*x]*(a+b*Csc[c+d*x])^(n-2)/(d*(n-1)) + 
  a/(n-1)*Int[(a+b*Csc[c+d*x])^(n-2)*(a*(n-1)+b*(3*n-4)*Csc[c+d*x]),x] /;
FreeQ[{a,b,c,d},x] && EqQ[a^2-b^2,0] && GtQ[n,1] && IntegerQ[2*n]

2.  ∫(((a+b Sec[c+d x]))^n)dx  when  (a^2)-(b^2)==0 ∧ 2n∈(SuperMinus[ℤ])

1:  ∫(1/(Sqrt[a+b Sec[c+d x]]))dx  when  (a^2)-(b^2)==0

Author: Martin on sci.math.symbolic on 10 March 2011

Derivation: Algebraic expansion

Basis: (1/(Sqrt[a+b z]))==((Sqrt[a+b z])/a)-((b z)/(a(Sqrt[a+b z])))

Rule: If  (a^2)-(b^2)==0, then

∫(1/(Sqrt[a+b Sec[c+d x]]))dx  ⟶  (1/a)∫(Sqrt[a+b Sec[c+d x]])dx-(b/a)∫((Sec[c+d x])/(Sqrt[a+b Sec[c+d x]]))dx

Program code:

Int[1/Sqrt[a_+b_.*csc[c_.+d_.*x_]],x_Symbol] :=
  1/a*Int[Sqrt[a+b*Csc[c+d*x]],x] - 
  b/a*Int[Csc[c+d*x]/Sqrt[a+b*Csc[c+d*x]],x] /;
FreeQ[{a,b,c,d},x] && EqQ[a^2-b^2,0]

2:  ∫(((a+b Sec[c+d x]))^n)dx  when  (a^2)-(b^2)==0 ∧ n≤-1 ∧ 2n∈ℤ

Derivation: Symmetric secant recurrence 2b with A->1,B->0,m->0

Rule: If  (a^2)-(b^2)==0 ∧ n≤-1 ∧ 2n∈ℤ, then

∫(((a+b Sec[c+d x]))^n)dx  ⟶  
((Tan[c+d x](((a+b Sec[c+d x]))^n))/(d (2n+1)))+(1/((a^2)(2n+1))) ∫(((a+b Sec[c+d x]))^(n+1)) (a(2n+1)-b(n+1)Sec[c+d x])dx

Program code:

Int[(a_+b_.*csc[c_.+d_.*x_])^n_,x_Symbol] :=
  -Cot[c+d*x]*(a+b*Csc[c+d*x])^n/(d*(2*n+1)) + 
  1/(a^2*(2*n+1))*Int[(a+b*Csc[c+d*x])^(n+1)*(a*(2*n+1)-b*(n+1)*Csc[c+d*x]),x] /;
FreeQ[{a,b,c,d},x] && EqQ[a^2-b^2,0] && LeQ[n,-1] && IntegerQ[2*n]

2.  ∫(((a+b Sec[c+d x]))^n)dx  when  (a^2)-(b^2)==0 ∧ 2n∉ℤ

1:  ∫(((a+b Sec[c+d x]))^n)dx  when  (a^2)-(b^2)==0 ∧ 2n∉ℤ ∧ a>0

Derivation: Piecewise constant extraction and integration by substitution

Basis: If  (a^2)-(b^2)==0, then (∂_x)(( Tan[c+d x])/((Sqrt[1+Sec[c+d x]])(Sqrt[1-Sec[c+d x]])))==0

Basis: If  (a^2)-(b^2)==0 ∧ a>0, then -((Tan[c+d x])/((Sqrt[1+Sec[c+d x]])(Sqrt[1-Sec[c+d x]]))) (( Tan[c+d x])/((Sqrt[1+(b/a) Sec[c+d x]]) (Sqrt[1-(b/a) Sec[c+d x]])))==1

Basis: Tan[c+d x] F[Sec[c+d x]]==(1/d) Subst[((F[x])/x),x,Sec[c+d x]] (∂_x)Sec[c+d x]

Rule: If  (a^2)-(b^2)==0 ∧ 2n∉ℤ ∧ a>0, then

∫(((a+b Sec[c+d x]))^n)dx  ⟶  (a^n) ∫(((1+(b/a) Sec[c+d x]))^n)dx  ⟶  

-(((a^n) Tan[c+d x])/((Sqrt[1+Sec[c+d x]])(Sqrt[1-Sec[c+d x]]))) ∫(( Tan[c+d x] (((1+(b/a) Sec[c+d x]))^(n-(1/2))))/(Sqrt[1-(b/a) Sec[c+d x]]))dx  ⟶ 

-(((a^n) Tan[c+d x])/(d (Sqrt[1+Sec[c+d x]])(Sqrt[1-Sec[c+d x]]))) Subst[∫((((1+((b x)/a)))^(n-(1/2)))/(x (Sqrt[1-((b x)/a)])))dx,x,Sec[c+d x]]

Program code:

Int[(a_+b_.*csc[c_.+d_.*x_])^n_,x_Symbol] :=
  a^n*Cot[c+d*x]/(d*Sqrt[1+Csc[c+d*x]]*Sqrt[1-Csc[c+d*x]])*
    Subst[Int[(1+b*x/a)^(n-1/2)/(x*Sqrt[1-b*x/a]),x],x,Csc[c+d*x]] /;
FreeQ[{a,b,c,d,n},x] && EqQ[a^2-b^2,0] && Not[IntegerQ[2*n]] && GtQ[a,0]

2:  ∫(((a+b Sec[c+d x]))^n)dx  when  (a^2)-(b^2)==0 ∧ 2n∉ℤ ∧ a≯0

Derivation: Piecewise constant extraction

Basis: If  (∂_x)((((a+b Sec[c+d x]))^n)/(((1+(b/a) Sec[c+d x]))^n))==0

Rule: If  (a^2)-(b^2)==0 ∧ 2n∉ℤ ∧ a≯0, then

∫(((a+b Sec[c+d x]))^n)dx  ⟶  (((a^(IntPart[n])) (((a+b Sec[c+d x]))^(FracPart[n])))/(((1+(b/a) Sec[c+d x]))^(FracPart[n]))) ∫(((1+(b/a) Sec[c+d x]))^n)dx

Program code:

Int[(a_+b_.*csc[c_.+d_.*x_])^n_,x_Symbol] :=
  a^IntPart[n]*(a+b*Csc[c+d*x])^FracPart[n]/(1+b/a*Csc[c+d*x])^FracPart[n]*Int[(1+b/a*Csc[c+d*x])^n,x] /;
FreeQ[{a,b,c,d,n},x] && EqQ[a^2-b^2,0] && Not[IntegerQ[2*n]] && Not[GtQ[a,0]]

4.  ∫(((a+b Sec[c+d x]))^n)dx  when  (a^2)-(b^2)≠0 ∧ 2n∈ℤ

1.  ∫(((a+b Sec[c+d x]))^n)dx  when  (a^2)-(b^2)≠0 ∧ 2n∈(SuperPlus[ℤ])

1:  ∫(Sqrt[a+b Sec[c+d x]])dx  when  (a^2)-(b^2)≠0

Rule: If  (a^2)-(b^2)≠0, then

∫(Sqrt[a+b Sec[c+d x]])dx  ⟶  
-((2 (a+b Sec[c+d x]))/(d (Sqrt[a+b])Tan[c+d x])) (Sqrt[((b (1+Sec[c+d x]))/(a+b Sec[c+d x]))]) (Sqrt[-((b (1-Sec[c+d x]))/(a+b Sec[c+d x]))]) EllipticPi[(a/(a+b)),ArcSin[((Sqrt[a+b])/(Sqrt[a+b Sec[c+d x]]))],((a-b)/(a+b))]

Program code:

Int[Sqrt[a_+b_.*csc[c_.+d_.*x_]],x_Symbol] :=
  2*(a+b*Csc[c+d*x])/(d*Rt[a+b,2]*Cot[c+d*x])*Sqrt[b*(1+Csc[c+d*x])/(a+b*Csc[c+d*x])]*Sqrt[-b*(1-Csc[c+d*x])/(a+b*Csc[c+d*x])]*
    EllipticPi[a/(a+b),ArcSin[Rt[a+b,2]/Sqrt[a+b*Csc[c+d*x]]],(a-b)/(a+b)] /;
FreeQ[{a,b,c,d},x] && NeQ[a^2-b^2,0]

2:  ∫(((a+b Sec[c+d x]))^(3/2))dx  when  (a^2)-(b^2)≠0

Derivation: Algebraic expansion

Basis: (((a+b z))^(3/2))==(a^2)((1+z)/(Sqrt[a+b z]))-((z ((a^2)-2 a b-(b^2) z))/(Sqrt[a+b z]))

Rule: If  (a^2)-(b^2)≠0, then

∫(((a+b Sec[c+d x]))^(3/2))dx  ⟶  ∫(((a^2)+b(2 a-b)Sec[c+d x])/(Sqrt[a+b Sec[c+d x]]))dx+(b^2)∫((Sec[c+d x] (1+Sec[c+d x]))/(Sqrt[a+b Sec[c+d x]]))dx

Program code:

Int[(a_+b_.*csc[c_.+d_.*x_])^(3/2),x_Symbol] :=
  Int[(a^2+b*(2*a-b)*Csc[c+d*x])/Sqrt[a+b*Csc[c+d*x]],x] + 
  b^2*Int[Csc[c+d*x]*(1+Csc[c+d*x])/Sqrt[a+b*Csc[c+d*x]],x] /;
FreeQ[{a,b,c,d},x] && NeQ[a^2-b^2,0]

3:  ∫(((a+b Sec[c+d x]))^n)dx  when  (a^2)-(b^2)≠0 ∧ n>2 ∧ 2n∈ℤ

Derivation: Secant recurrence 1b with A->(a^2),B->2a b,C->(b^2),m->0,n->n-2

Rule: If  (a^2)-(b^2)≠0 ∧ n>2 ∧ 2n∈ℤ, then

∫(((a+b Sec[c+d x]))^n)dx  ⟶  
(((b^2) Tan[c+d x](((a+b Sec[c+d x]))^(n-2)))/(d(n-1)))+
(1/(n-1))∫(((a+b Sec[c+d x]))^(n-3)) ((a^3)(n-1)+b((b^2)(n-2)+3 (a^2)(n-1))Sec[c+d x]+a (b^2)(3n-4)((Sec[c+d x])^2))dx

Program code:

Int[(a_+b_.*csc[c_.+d_.*x_])^n_,x_Symbol] :=
  -b^2*Cot[c+d*x]*(a+b*Csc[c+d*x])^(n-2)/(d*(n-1)) + 
  1/(n-1)*Int[(a+b*Csc[c+d*x])^(n-3)*
    Simp[a^3*(n-1)+(b*(b^2*(n-2)+3*a^2*(n-1)))*Csc[c+d*x]+(a*b^2*(3*n-4))*Csc[c+d*x]^2,x],x] /;
FreeQ[{a,b,c,d},x] && NeQ[a^2-b^2,0] && GtQ[n,2] && IntegerQ[2*n]

2.  ∫(((a+b Sec[c+d x]))^n)dx  when  (a^2)-(b^2)≠0 ∧ 2n∈(SuperMinus[ℤ])

1:  ∫(1/(a+b Sec[c+d x]))dx  when  (a^2)-(b^2)≠0

Derivation: Algebraic expansion

Basis: (1/(a+b z))==(1/a)-((b z)/(a(a+b z)))

Rule: If (a^2)-(b^2)≠0, then

∫(1/(a+b Sec[c+d x]))dx  ⟶  (x/a)-(b/a)∫((Sec[c+d x])/(a+b Sec[c+d x]))dx  ⟶  (x/a)-(1/a)∫(1/(1+((a Cos[c+d x])/b)))dx

Program code:

Int[1/(a_+b_.*csc[c_.+d_.*x_]),x_Symbol] :=
  x/a - 1/a*Int[1/(1+a/b*Sin[c+d*x]),x] /;
FreeQ[{a,b,c,d},x] && NeQ[a^2-b^2,0]

2:  ∫(1/(Sqrt[a+b Sec[c+d x]]))dx  when  (a^2)-(b^2)≠0

Rule: If  (a^2)-(b^2)≠0, then

∫(1/(Sqrt[a+b Sec[c+d x]]))dx  ⟶  
-((2 (Sqrt[a+b]))/(a d Tan[c+d x])) (Sqrt[((b (1-Sec[c+d x]))/(a+b))]) (Sqrt[-((b (1+Sec[c+d x]))/(a-b))]) EllipticPi[((a+b)/a),ArcSin[((Sqrt[a+b Sec[c+d x]])/(Sqrt[a+b]))],((a+b)/(a-b))]

Program code:

Int[1/Sqrt[a_+b_.*csc[c_.+d_.*x_]],x_Symbol] :=
  2*Rt[a+b,2]/(a*d*Cot[c+d*x])*Sqrt[b*(1-Csc[c+d*x])/(a+b)]*Sqrt[-b*(1+Csc[c+d*x])/(a-b)]*
    EllipticPi[(a+b)/a,ArcSin[Sqrt[a+b*Csc[c+d*x]]/Rt[a+b,2]],(a+b)/(a-b)] /;
FreeQ[{a,b,c,d},x] && NeQ[a^2-b^2,0]

3:  ∫(((a+b Sec[c+d x]))^n)dx  when  (a^2)-(b^2)≠0 ∧ n<-1 ∧ 2n∈ℤ

Derivation: Secant recurrence 2b with A->1,B->0,C->0,m->0

Rule: If  (a^2)-(b^2)≠0 ∧ n<-1 ∧ 2n∈ℤ, then

∫(((a+b Sec[c+d x]))^n)dx  ⟶  
-(((b^2) Tan[c+d x](((a+b Sec[c+d x]))^(n+1)))/(a d (n+1) ((a^2)-(b^2))))+
(1/(a (n+1) ((a^2)-(b^2))))∫(((a+b Sec[c+d x]))^(n+1)) (((a^2)-(b^2)) (n+1)-a b(n+1)Sec[c+d x]+(b^2)(n+2)((Sec[c+d x])^2))dx

Program code:

Int[(a_+b_.*csc[c_.+d_.*x_])^n_,x_Symbol] :=
  b^2*Cot[c+d*x]*(a+b*Csc[c+d*x])^(n+1)/(a*d*(n+1)*(a^2-b^2)) + 
  1/(a*(n+1)*(a^2-b^2))*Int[(a+b*Csc[c+d*x])^(n+1)*Simp[(a^2-b^2)*(n+1)-a*b*(n+1)*Csc[c+d*x]+b^2*(n+2)*Csc[c+d*x]^2,x],x] /;
FreeQ[{a,b,c,d},x] && NeQ[a^2-b^2,0] && LtQ[n,-1] && IntegerQ[2*n]

X:  ∫(((a+b Sec[c+d x]))^n)dx  when  (a^2)-(b^2)≠0 ∧ 2n∉ℤ

Rule: If (a^2)-(b^2)≠0 ∧ 2n∉ℤ, then

∫(((a+b Sec[c+d x]))^n)dx  ⟶  ∫(((a+b Sec[c+d x]))^n)dx

Program code:

Int[(a_+b_.*csc[c_.+d_.*x_])^n_,x_Symbol] :=
  Unintegrable[(a+b*Csc[c+d*x])^n,x] /;
FreeQ[{a,b,c,d,n},x] && NeQ[a^2-b^2,0] && Not[IntegerQ[2*n]]